//
//  ByProductSkuCollectionView.h
//  hutouben_ios
//
//  Created by pro on 16/11/30.
//  Copyright © 2016年 mc. All rights reserved.
//

#import <UIKit/UIKit.h>

@class ByViewDetailSkuCollection;

// 数据源
@protocol ByProductSkuCollectionViewDataSource <NSObject>

@required
// 组数
- (NSInteger)numOfSections:(ByViewDetailSkuCollection *)collectionView;
// 每组的元素数
- (NSInteger)numOfItems:(ByViewDetailSkuCollection *)collectionView inSection:(NSInteger)section;
// 每个元素的尺寸
- (CGSize)collectionView:(ByViewDetailSkuCollection *)collectionView sizeForviewAtIndexPath:(NSIndexPath *)indexPath;
// 每个元素的视图
- (UIView *)collectionView:(ByViewDetailSkuCollection *)collectionView viewAtIndexPath:(NSIndexPath *)indexPath;
@optional
// 每组的标题（如设置，则包含标题视图）
- (NSString *)collectionView:(ByViewDetailSkuCollection *)collectionView titleInSection:(NSInteger)section;
// 元素的点击事件
- (void)collectionView:(ByViewDetailSkuCollection *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath;
// 数量变化
- (void)collectionView:(ByViewDetailSkuCollection *)collectionView didModifyCount:(NSInteger(^)())modify;


@end

// 自定义的多规格视图（模仿collectionview）
@interface ByViewDetailSkuCollection : UIView

// 数据源
@property (nonatomic, weak) id<ByProductSkuCollectionViewDataSource> dataSource;

@property (nonatomic, copy) NSString *price;

// 刷新视图
- (void)reloadData;

@end
